<ix-modal-header
  [title]="isNew() ? ('Add Port' | translate) : ('Edit Port' | translate)"
  [loading]="isLoading()"
></ix-modal-header>

<mat-card>
  <mat-card-content>
    <form class="ix-form-container" [formGroup]="form" (submit)="onSubmit()">
      <ix-fieldset>
        <ix-select
          formControlName="addr_trtype"
          [label]="'Transport Type' | translate"
          [options]="types$"
          [required]="true"
        ></ix-select>

        <ix-input
          formControlName="addr_trsvcid"
          [label]="'Port' | translate"
          [type]="isFibreChannel ? 'text' : 'number'"
          [required]="true"
        ></ix-input>

        <ix-select
          formControlName="addr_traddr"
          [label]="'Address' | translate"
          [required]="true"
          [options]="addresses$"
          [hint]="isTcp ? (helptext.onlyStaticIpsShown | translate) : ''"
        ></ix-select>
      </ix-fieldset>

      <ix-form-actions>
        <button
          mat-button
          type="submit"
          color="primary"
          ixTest="save"
          [disabled]="form.invalid || isLoading()"
        >
          {{ 'Save' | translate }}
        </button>
      </ix-form-actions>
    </form>
  </mat-card-content>
</mat-card>
